# name : coxph_fit (wrap of coxph.fit)
# key: coxph_fit
# contributor: Shuguang Sun
# --
N <- nrow(${1:dt)
${4:fit} <- with(
  $1,
  {
    rx <-  model.matrix(~${2:trt})[, -1, drop=FALSE]
    strata <- as.integer(strata(${3:strataid}))

    coxph.fit(
      x = rx,
      y = Surv(AVAL, EVENT),
      strat = strata,
      controls = coxph.control(),
      method = "efron",
      rownames = 1:N
    )
  }
)
$4$coefficients